
Partial Class Tags
    Inherits System.Web.UI.Page


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Page.IsPostBack Then Return

        Me.litHeader.Text = String.Format("Browse by tag: {0}", Request.QueryString("tag"))
        Me.Page.Title = Me.litHeader.Text
        Dim tag As String = Request.QueryString("tag")
        Me.gvTaggedPages.DataSource = TagLib.Tagging.GetDocumentsWithTag(tag)
        Me.gvTaggedPages.DataBind()

        Dim link As New HtmlLink
        link.Attributes.Add("type", "application/rss+xml")
        link.Attributes.Add("rel", "alternate")
        link.Attributes.Add("title", "Documents tagged """ & tag & """")
        link.Attributes.Add("href", String.Format("http://www.mises.org/Feeds/tags.ashx?tag={0}", tag))
        Me.Page.Header.Controls.AddAt(1, link)

        Me.lnkRSS.NavigateUrl = String.Format("http://www.mises.org/Feeds/tags.ashx?tag={0}", tag)
        Me.lnkRSS.Text = "Documents tagged """ & tag & """"

    End Sub
End Class
